package co.gov.medellin.ssti.sub.model.service.impl;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import co.gov.medellin.ssti.sub.model.dao.SubprogramaSedeDAO;
import co.gov.medellin.ssti.sub.model.dao.exception.DAOException;
import co.gov.medellin.ssti.sub.model.service.SubprogramaSedeService;
import co.gov.medellin.ssti.sub.model.vo.SubprogramaSedeVO;

@Service
public class SubprogramaSedeServiceImpl implements SubprogramaSedeService {
	@Autowired
	SubprogramaSedeDAO subprogramaSedeDAOImpl2;

	public Collection<SubprogramaSedeVO> findSubprogramaSedeByCriteria(
			SubprogramaSedeVO criteria) {
		try {
			return subprogramaSedeDAOImpl2
					.findSubprogramaSedeByCriteria(criteria);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public Collection<SubprogramaSedeVO> findSubprogramaSedeByCode(
			Long codeSubprogramaSede) {
		try {
			return subprogramaSedeDAOImpl2
					.findSubprogramaSedeByCode(codeSubprogramaSede);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public void insertUsuarioSede(Long codeSubprogramaSede, Long codeUser,
			String[] param) {
		try {
			subprogramaSedeDAOImpl2.insertUsuarioSede(codeSubprogramaSede,
					codeUser, param);
		} catch (Exception e) {
			throw new DAOException(e);
		}

	}

	public String[] insertSubprogramaSede(Long codeSede, Long codeSubprograma,
			String desde, String hasta, String cantidad, String[] param) {
		try {
			return subprogramaSedeDAOImpl2.insertSubprogramaSede(codeSede,
					codeSubprograma, desde, hasta, cantidad, param);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public boolean actualizarSubproSede(Long codeSubprogramaSede,
			String[] parArr) {
		try {
			return subprogramaSedeDAOImpl2.actualizarSubproSede(
					codeSubprogramaSede, parArr);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

}
